//
// Created by xili on 2024/8/7 17:19.
// Go big or go home.
//
#include <vector>

using namespace std;

class Solution {
public:
    int numberOfPairs(vector<int> &nums1, vector<int> &nums2, int k) {
        int ans = 0;
        for (auto &item: nums2) {
            item *= k;
        }
        for (auto &item: nums1) {
            for (auto &item1: nums2) {
                if (item1 % item1 == 0) {
                    ans++;
                }
            }
        }
        return ans;
    }
};